<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script>
    $(document).ready(function(){
    	searchListForm();
    });
    
   //检索 
   function searchListForm() {
    	var params = $("#searchForm").serialize();
    	$("#activity_pane").showLoading();
		$.post("${ctx}/specimen/demand/selectEmployee",params, function(result) {
			var listHtml = result["sampleEmployee"];
			$("#listHtml").html(listHtml);
			$("#activity_pane").hideLoading();
		}, 'json');
	} 
            
    function selectIndent() {
    	if ($(".trSelected").length == 0) {
    		tipParent("请选择员工");
			return;
		}
    	//获取 iframe 数量 
    	var frLength = window.parent.frames.length;
    	//父画面下标  
    	var parentIndex = frLength-2;
    	var employeeId = $("#listHtml tr.trSelected").find(".employeeId").val();
    	var employeeName = $("#listHtml tr.trSelected").find(".employeeName").val();
    	window.parent.frames[parentIndex].setEmployeeInfo(employeeId,employeeName);
        closeWin(); 
	}
    
    //选择按钮事件
    function selectFunction(obj){
    	$("#listHtml tr").removeClass('trSelected');
    	$(obj).addClass('trSelected');
    	
    }
    
	 //重置
	function clean() {
		 $("#employeeName").val("");
		 searchListForm();
	}    
    </script>
    
</head>
<body>
<form id="searchForm">
<input type="hidden" id="operationFlag" name="operationFlag" value="${sampleEmployeeEntity.operationFlag}"/>
<div class="layerHeader clearfix" style="width: 800px;">
	<p class="headerTitle">
		<c:choose>
			<c:when test="${sampleEmployeeEntity.operationFlag == '0'}">
				选择打版员工
			</c:when>
			<c:when test="${sampleEmployeeEntity.operationFlag == '1'}">
				选择打样员工
			</c:when>
		</c:choose>
	</p>
	<div class="headerButton clearfix">
                <button type="button" onclick="searchListForm();"><spring:message code="commom_check" /></button>
                <button type="button" onclick="clean();"><spring:message code="common_reset" /></button>
                <button type="button" onclick="selectIndent();"><spring:message code="style_selectOK" /></button>
                <button type="button" onclick="closeWin();"><spring:message code="btn_cancle" /></button>
    </div>
</div>
<div class="listArea" style="width: 800px" id="activity_pane">
	<div class="listBg">
	    <div class="searchArea clearfix">
            <div class=" clearfix">
                <!-- 姓名 -->
                <div class="searchInp clearfix">
                    <p>姓名</p>
                    <input type="text" id="employeeName" name="employeeName">
                </div>
            </div>
        </div>
	
        <div class="tableArea tabBoxSm" >
            <div class="tableScroll tabSm" style="overflow: auto;height: 357px;width:765px;">
                <table cellpadding="0" class="tableHead " >
                    <thead>
                    <tr>
                        <th><p style="width:50px;"><spring:message code="indent_select_no" /></p></th>
                        <th><p style="width:200px;">员工号</p></th>
                        <th><p style="width:200px;">员工姓名</p></th>	
                        <th><p style="width:140px;">性别</p></th>
                        <th><p style="width:150px;">任务数量</p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody" >              
                    <tbody id = "listHtml">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id = "paging" ></div>
</div>
</form>
</body>
</html>